<?php
//自动加载类
class BootStrap{
    protected function autoload(string $class){
        $file = str_replace('\\','/',$class).'.php';
        if(!is_file($file)){
            throw new Exception('file is not exists');
        }else{
            require $file;
        }
    }

    //自动加载
    public static function boot(){
        spl_autoload_register([new self(),'autoload']);
    }
}
BootStrap::boot();

